package me.cloudcat.develop.controller.configuration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import me.cloudcat.develop.entity.configuration.Menu;
import me.cloudcat.develop.service.configuration.MenuService;
import net.sf.json.JSONObject;

@Controller
@RequestMapping(value="/menu")
public class MenuController {
	
	@Autowired
	MenuService menuService;
	
	@ResponseBody
	@RequestMapping(value="/testZtree",method=RequestMethod.POST)
	public JSONObject testZtree(Model model){
		Menu findOne = menuService.findOne(3L);
		JSONObject fromObject = JSONObject.fromObject(findOne);
		return fromObject;
	}
	
}
